<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        // 编写一个JavaScript对象
        const user = {
            name: "long",
            age: 3,
            sex: "男"
        };
        console.log(user);
        // 将js对象转换为JSON对象
        const json = JSON.stringify(user);
        console.log(json);

        // 将 JSON 对象转换为JavaScript对象
        const obj = JSON.parse(json);
        console.log(obj);
    </script>
</head>
<body>

</body>
</html>